
#define SQLITE_OS_WIN

namespace Community.CsharpSqlite
{
    public partial class Sqlite3
    {
        /*
    ** 2001 September 16
    **
    ** The author disclaims copyright to this source code.  In place of
    ** a legal notice, here is a blessing:
    **
    **    May you do good and not evil.
    **    May you find forgiveness for yourself and forgive others.
    **    May you share freely, never taking more than you give.
    **
    ******************************************************************************
    **
    ** This header file (together with is companion C source-code file
    ** "os.c") attempt to abstract the underlying operating system so that
    ** the SQLite library will work on both POSIX and windows systems.
    **
    ** This header file is #include-ed by sqliteInt.h and thus ends up
    ** being included by every source file.
    *************************************************************************
    **  Included in SQLite3 port to C#-SQLite;  2008 Noah B Hart
    **  C#-SQLite is an independent reimplementation of the SQLite software library
    **
    **  SQLITE_SOURCE_ID: 2009-12-07 16:39:13 1ed88e9d01e9eda5cbc622e7614277f29bcc551c
    **
    **  $Header: Community.CsharpSqlite/src/os_h.cs,v bcbd36f24b23 2010/02/18 17:35:24 Noah $
    *************************************************************************
    */
#if !_SQLITE_OS_H_
        //#define _SQLITE_OS_H_

        /*
    ** Figure out if we are dealing with Unix, Windows, or some other
    ** operating system.  After the following block of preprocess macros,
    ** all of SQLITE_OS_UNIX, SQLITE_OS_WIN, SQLITE_OS_OS2, and SQLITE_OS_OTHER
    ** will defined to either 1 or 0.  One of the four will be 1.  The other
    ** three will be 0.
    */
        //#if defined(SQLITE_OS_OTHER)
        //# if SQLITE_OS_OTHER==1
        //#   undef SQLITE_OS_UNIX
        //#   define SQLITE_OS_UNIX 0
        //#   undef SQLITE_OS_WIN
        //#   define SQLITE_OS_WIN 0
        //#   undef SQLITE_OS_OS2
        //#   define SQLITE_OS_OS2 0
        //# else
        //#   undef SQLITE_OS_OTHER
        //# endif
        //#endif
        //#if !(SQLITE_OS_UNIX) && !SQLITE_OS_OTHER)
        //# define SQLITE_OS_OTHER 0
        //# ifndef SQLITE_OS_WIN
        //#   if defined(_WIN32) || defined(WIN32) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__BORLANDC__)
        //#     define SQLITE_OS_WIN 1
        //#     define SQLITE_OS_UNIX 0
        //#     define SQLITE_OS_OS2 0
        //#   elif defined(__EMX__) || defined(_OS2) || defined(OS2) || defined(_OS2_) || defined(__OS2__)
        //#     define SQLITE_OS_WIN 0
        //#     define SQLITE_OS_UNIX 0
        //#     define SQLITE_OS_OS2 1
        //#   else
        //#     define SQLITE_OS_WIN 0
        //#     define SQLITE_OS_UNIX 1
        //#     define SQLITE_OS_OS2 0
        //#  endif
        //# else
        //#  define SQLITE_OS_UNIX 0
        //#  define SQLITE_OS_OS2 0
        //# endif
        //#else
        //# ifndef SQLITE_OS_WIN
        //#  define SQLITE_OS_WIN 0
        //# endif
        //#endif

        private const bool SQLITE_OS_WIN = true;
        private const bool SQLITE_OS_UNIX = false;
        private const bool SQLITE_OS_OS2 = false;

        /*
    ** Determine if we are dealing with WindowsCE - which has a much
    ** reduced API.
    */
        //#if defined(_WIN32_WCE)
        //# define SQLITE_OS_WINCE 1
        //#else
        //# define SQLITE_OS_WINCE 0
        //#endif

        /*
    ** Define the maximum size of a temporary filename
    */
#if SQLITE_OS_WIN
        //# include <windows.h>
        private const int MAX_PATH = 260;
        private const int SQLITE_TEMPNAME_SIZE = (MAX_PATH + 50); //# define SQLITE_TEMPNAME_SIZE (MAX_PATH+50)
#elif SQLITE_OS_OS2
# if FALSE //(__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 3) && OS2_HIGH_MEMORY)
//#  include <os2safe.h> /* has to be included before os2.h for linking to work */
# endif
//# define INCL_DOSDATETIME
//# define INCL_DOSFILEMGR
//# define INCL_DOSERRORS
//# define INCL_DOSMISC
//# define INCL_DOSPROCESS
//# define INCL_DOSMODULEMGR
//# define INCL_DOSSEMAPHORES
//# include <os2.h>
//# include <uconv.h>
//# define SQLITE_TEMPNAME_SIZE (CCHMAXPATHCOMP)
//#else
//# define SQLITE_TEMPNAME_SIZE 200
#endif

        /* If the SET_FULLSYNC macro is not defined above, then make it
** a no-op
*/
        //#if !SET_FULLSYNC
        //# define SET_FULLSYNC(x,y)
        //#endif

        /*
    ** The default size of a disk sector
    */
#if !SQLITE_DEFAULT_SECTOR_SIZE
        private const int SQLITE_DEFAULT_SECTOR_SIZE = 512; //# define SQLITE_DEFAULT_SECTOR_SIZE 512
#endif

        /*
** Temporary files are named starting with this prefix followed by 16 random
** alphanumeric characters, and no file extension. They are stored in the
** OS's standard temporary file directory, and are deleted prior to exit.
** If sqlite is being embedded in another program, you may wish to change the
** prefix to reflect your program's name, so that if your program exits
** prematurely, old temporary files can be easily identified. This can be done
** using -DSQLITE_TEMP_FILE_PREFIX=myprefix_ on the compiler command line.
**
** 2006-10-31:  The default prefix used to be "sqlite_".  But then
** Mcafee started using SQLite in their anti-virus product and it
** started putting files with the "sqlite" name in the c:/temp folder.
** This annoyed many windows users.  Those users would then do a
** Google search for "sqlite", find the telephone numbers of the
** developers and call to wake them up at night and complain.
** For this reason, the default name prefix is changed to be "sqlite"
** spelled backwards.  So the temp files are still identified, but
** anybody smart enough to figure out the code is also Utility.Likely smart
** enough to know that calling the developer will not help get rid
** of the file.
*/
#if !SQLITE_TEMP_FILE_PREFIX
        private const string SQLITE_TEMP_FILE_PREFIX = "etilqs_"; //# define SQLITE_TEMP_FILE_PREFIX "etilqs_"
#endif



        /*
    ** Wrapper around OS specific sqlite3_os_init() function.
    */
        //int sqlite3OsInit(void);

        /*
    ** Functions for accessing sqlite3_file methods
    */
        //int sqlite3OsClose(sqlite3_file*);
        //int sqlite3OsRead(sqlite3_file*, void*, int amt, long offset);
        //int sqlite3OsWrite(sqlite3_file*, const void*, int amt, long offset);
        //int sqlite3OsTruncate(sqlite3_file*, long size);
        //int sqlite3OsSync(sqlite3_file*, int);
        //int sqlite3OsFileSize(sqlite3_file*, long pSize);
        //int sqlite3OsLock(sqlite3_file*, int);
        //int sqlite3OsUnlock(sqlite3_file*, int);
        //int sqlite3OsCheckReservedLock(sqlite3_file *id, int pResOut);
        //int sqlite3OsFileControl(sqlite3_file*,int,void*);
        //#define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0
        private const uint SQLITE_FCNTL_DB_UNCHANGED = 0xca093fa0;

        //int sqlite3OsSectorSize(sqlite3_file *id);
        //int sqlite3OsDeviceCharacteristics(sqlite3_file *id);

        /*
    ** Functions for accessing sqlite3_vfs methods
    */
        //int sqlite3OsOpen(sqlite3_vfs *, const char *, sqlite3_file*, int, int *);
        //int sqlite3OsDelete(sqlite3_vfs *, const char *, int);
        //int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int pResOut);
        //int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *);
#if !SQLITE_OMIT_LOAD_EXTENSION
        //void *sqlite3OsDlOpen(sqlite3_vfs *, const char *);
        //void sqlite3OsDlError(sqlite3_vfs *, int, char *);
        //void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void);
        //void sqlite3OsDlClose(sqlite3_vfs *, void *);
#endif
        //int sqlite3OsRandomness(sqlite3_vfs *, int, char *);
        //int sqlite3OsSleep(sqlite3_vfs *, int);
        //int sqlite3OsCurrentTime(sqlite3_vfs *, double*);

        /*
    ** Convenience functions for opening and closing files using
    ** Malloc.sqlite3Malloc() to obtain space for the file-handle structure.
    */
        //int sqlite3OsOpenMalloc(sqlite3_vfs *, const char *, sqlite3_file **, int,int*);
        //int sqlite3OsCloseFree(sqlite3_file *);
#endif
        // * _SQLITE_OS_H_ */
    }
}